package com.dustedpixels.commons.search.util;

import com.dustedpixels.commons.search.implbase.FinderImplBase;

/**
 * Finder which finds no results.
 * 
 * @param <T> The class found.
 */
public class StubFinder<T> extends FinderImplBase<T> {
    private boolean isRunning = false;
    
    public final void beginSearch(String query) {
        if (isRunning) {
            throw new IllegalStateException("Search already running.");
        }
        
        isRunning = true;
    }
    
    public void endSearch() {
        if (!isRunning) {
            throw new IllegalStateException("Search is not running.");
        }
        
        isRunning = false;
    }

    public T getNextResult() {
        return null;
    }

    public boolean isNextResultImmediate() {
        return true;
    }

    public boolean isRunning() {
        return isRunning;
    }
}
